The generic hash
function is recommended for most applications. It uses
dynamic length
BLAKE2b
where output size can be any value between 16 bytes (128bit) and 64 bytes (512bit).
The scrypt hash function is designed to be CPU and memory expensive to protect
against brute force attacks. This algorithm is also used by the password_store
function.
The argon2 hash function is also designed to be CPU and memory expensive to protect
against brute force attacks. Argon2 is a password-hashing function that summarizes the
state of the art in the design of memory-hard functions
The shorthash
function is a special 8 byte (64 bit) hash based on
SipHash-2-4.
The output of this function is only 64 bits (8 bytes). It is useful for in e.g.
Hash tables, but it should not be considered collision-resistant.
Hash functions can be used for HMAC by specifying a secret key
. They key size
for shorthash
is 16 bytes, for sha256
it is 32 bytes and for sha512
it is 64 bytes. For hash
the key size can be any value between 16 and 62,
recommended is at least 32.